{extend name='main'}



{block name="content"}
<div class="layui-tab layui-tab-card">
    <ul class="layui-tab-title">
        {foreach ['shop'=>lang('商城前台'),'system'=>lang('商城后台'), 'export_declaration' => lang('出口报关')] as $k=>$v}
        {if isset($type) and $type eq $k}
        <li class="layui-this" data-open="{:url('index')}?type={$k}">{$v}</li>
        {else}
        <li data-open="{:url('index')}?type={$k}">{$v}</li>
        {/if}
        {/foreach}
    </ul>
    <div class="layui-tab-content">
        <form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="UserTable">
            <div class="layui-card-body padding-left-40 layui-col-space10">

                <div class="layui-form-item">

                    <textarea name="content" placeholder="请输入内容" lay-verify="" class="layui-textarea" >{$content|default=""}</textarea>
                    <p class="help-block"></p >

                </div>

                <input type='hidden' value='{$type}' name='type'>
                <div class="layui-form-item text-center">
                    <button class="layui-btn" type='submit' lay-submit="">保存数据</button>
                    <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    $(function () {
        // 异步加载富文本编辑器
        require(['ckeditor'], function () {
            setTimeout(function () {
                // 初始化富文本编辑器
                window.createEditor('[name=content]', {height: 350,
                    link: {
                        addTargetToExternalLinks: true, // 这个选项会自动为外部链接添加 target="_blank" 属性
                        decorators: {
                            add: [
                                {
                                    mode: 'manual',
                                    label: 'Open in a new tab',
                                    attributes: { target: '_blank', rel: 'noopener noreferrer' },
                                    defaultValue: true
                                }
                            ]
                        }
                    }
                });
            },500)
        });
    })

</script>
{/block}